import 'package:flutter/cupertino.dart';

class PlaceholderImage extends StatelessWidget {
  final String placeholder;
  final String imgUrl;
  final double width;
  final double height;

  PlaceholderImage(
      {this.placeholder, this.imgUrl, this.width = 30, this.height = 30});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: FadeInImage(
          width: width,
          height: height,
          placeholder: AssetImage(placeholder),
          image: imgUrl.isEmpty ? AssetImage(placeholder) : NetworkImage(imgUrl)
      ),
    );
  }
}
